package com.justnow.offer;


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;


/**
 * @author justnow
 * Created on 2020-09-16
 * Description
 */
public class JiShan01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            ArrayList<Integer> list = getLevelNumber(i);
            ArrayList<Integer> temp = new ArrayList<>(list);
            if (i == 1) {
                System.out.println(1);
            } else {
                temp.remove(temp.size() - 1);
                Collections.reverse(temp);
                for (Integer integer : list) {
                    System.out.print(integer + " ");
                }
                for (Integer integer : temp) {
                    System.out.print(integer + " ");
                }
                System.out.println();
            }
        }
    }

    public static ArrayList<Integer> getLevelNumber(int n) {
        ArrayList<Integer> list = new ArrayList<>();
        int[] dp = new int[n + 1];
        dp[0] = 0;
        dp[1] = 1;
        list.add(dp[1]);
        for (int i = 2; i <= n; i++) {
            dp[i] = dp[i - 2] + dp[i - 1];
            list.add(dp[i]);
        }
        return list;
    }

}
